package com.yongqi.duocai.mapper;

import com.yongqi.duocai.entity.ShoppingCart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yongqi.duocai.entity.result.ChooseShoppingInfoResult;
import com.yongqi.duocai.entity.result.ShoppingCarResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 夏亮辉
 * @since 2021-06-19
 */

@Repository
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    List<ShoppingCarResult> selectAllByUseId(@Param("id")Integer id);

    /**
     * 根据 id 查询选中的商品信息
     * @param ids
     * @return
     */
    List<ChooseShoppingInfoResult> selectChoseById(@Param("ids") Integer[] ids);

    List<ChooseShoppingInfoResult> selectGoods(@Param("userId")Integer userId, @Param("ids") Integer[] ids);
}
